﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HR.Appointments.Service;

namespace Output
{
    class Program
    {
        static void Main(string[] args)
        {
            //ActivityDAO dao = new ActivityDAO();
            //{
            //    foreach (HR.Appointments.Service.Activity action in dao.GetAll())
            //    {
            //        Console.WriteLine(action.ActionId.ToString() + " "
            //            + action.Name + " " + action.Duration.ToString());
            //    }
            //}


            //OpenHours h = OpenHoursDAO.Create().GetByDate(1, DateTime.Now);

            //DateTime date = DateTime.Parse("28.4.2008");

            //DAO.Instance.Initialize();
            //OpenHoursEntity h2 = DAO.Instance.OpenHours.GetByDate(1, date);
            //Console.WriteLine(h2.ToString());

            //List<ReservedTimeEntity> rList = DAO.Instance.ReservedTime.GetByDate(1, date);
            //foreach (ReservedTimeEntity time in rList)
            //{
            //    Console.WriteLine(time.ToString());
            //}

            //foreach(OrderEntity o in DAO.Instance.Order.GetByDate(1, date))
            //{
            //    Console.WriteLine(o.ToString());
            //}

            //foreach(CompanyEntity cmp in DAO.Instance.Company.GetAll())
            //{
            //    Console.WriteLine(cmp.ToString());
            //}

            //SOAFacadeClient client = new SOAFacadeClient();
            //foreach(Output.SOAFacadeService.Action a in client.GetActivities(1))
            //{
            //    Console.WriteLine(a.ActionId.ToString() + " " +
            //        a.Name + " " + a.ToString());
            //}
            ServiceFacade facade = new ServiceFacade(true);
            {
                foreach (CompanyEntity cmp in facade.AvailableCompanies())
                {
                    Console.WriteLine(cmp.ToString());
                
                    foreach (ActivityEntity obj in facade.Anonymous().GetActivities(cmp.CompanyId))
                    {
                        Console.WriteLine(obj.ToString());
                    }

                    //HR.Appointments.Service.

                    foreach (WorkstationEntity obj in facade.Employee().GetWorkstations(cmp.CompanyId))
                    {
                        Console.WriteLine(obj.ToString());
                    }
                }
            }
        }
    }
}
